package com.choco.jsondb;

public class Context {
    private static final String KV_FILE = "kv.ser";
    private static final String ARRAY_FILE = "array.ser";

    public static final String DEFAULT_KEY = "null";

    private String workingFolder;
    private int mode;

    public Context(String folder, int mode){
        this.workingFolder = folder;
        this.mode = mode;
    }

    public String getFile(){
        if(mode == JSONDB.KV_MODE) {
            return getWorkingFolder() + "/" + Context.KV_FILE;
        }else{
            return getWorkingFolder() + "/" + Context.ARRAY_FILE;
        }
    }

    public String getWorkingFolder() {
        return workingFolder;
    }

    public int getMode() {
        return mode;
    }
}
